import time
import  datetime
def metric(fn):
    start_time = time.time()
    fn()
    end_time = time.time()
    print('耗时：{:.20f}s'.format(end_time - start_time))
    return fn
@ metric
def func():
    time.sleep(0.8)
func()